package studay.strategy;

/**
 * @program: 设计模式
 * @description:
 * @author: Tom
 * @create: 2022-01-07 21:27
 **/
public class DiscountActivity extends Strategy{

    private  double rate;
    public DiscountActivity(double rate){
        this.rate=rate;
    }
    @Override
    public double computePrice(ProductOrder productOrder) {
        //具体的策略非常复杂
        return productOrder.getOldPrice()*rate;
    }
}
